import 'dart:html';

import 'package:angular/angular.dart';
import 'package:angular_router/angular_router.dart';
import 'package:logging/logging.dart';
import 'package:angular_components/laminate/popup/module.dart';
import 'package:angular_components/laminate/overlay/module.dart';
import 'package:angular_components/material_datepicker/module.dart';
import '{{{ galleryImportUri }}}' as app;

import 'main.template.dart' as ng;

Logger _logger = Logger("ads.acx2.demo");

void main() {
  Logger.root.onRecord.listen((x) => print("${x.level}: ${x.message}"));

  // Start angular.
  runApp(app.GalleryComponentNgFactory, createInjector: galleryInjector);
}

@Injectable()
HtmlElement materialContentElement(Document document) {
  return document.querySelector('material-content');
}

@GenerateInjector([
  routerProvidersHash,
  popupBindings,
  datepickerBindings,
  Provider(overlayContainerParent, useFactory: materialContentElement),
])

final InjectorFactory galleryInjector = ng.galleryInjector$Injector;
